<template>
  <div id="guide" @click="hideClick()" v-if="isShow">
    <div class="modal" v-if="isShow" @touchstart="hide($event)">
      <div class="modal-body">
        <div class="close"><span>{{secText}}S</span>后自动关闭</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'guide',
  data () {
    return {
       isShow: true,
       secText: 5
    }
  },
  created(){
    var self = this;
    var timer = setInterval(function(){
      self.secText = self.secText - 1;
      if (self.secText == 0) {
        self.isShow = false;
        clearInterval(timer);
      }
    },1000);
  },
  methods: {
    hideClick: function(){
        this.isShow = false;
    },
    hide: function(e){
      e.returnValue = false;
    }
  },
}
</script>
<style scoped lang="less">
#guide{
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
}
.modal{
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
  // background-color: rgba(0, 0, 0, 0.5);
  .modal-body{
    width: 592px;
    height: 780px;
    border-radius: 12px;
    margin: 220px auto 0;
    text-align: center;
    position: relative;
    background-color: white;
    background-image: url(../../assets/images/jiaguanzhu.png);
    background-position: center center;
    background-size: 592px 780px;
    background-repeat: no-repeat;
    position: relative;
    .close {
      text-align: center;
      font-size: 20px;
      color: #f7881b;
      font-weight: 500;
      position: absolute;
      bottom: 30px;
      width: 100%;
      left: 0;
      right: 0;
      font-size: 18px;
      span {
        font-size: 24px;
      }
    }
  }
}

</style>
